package com.zznj.xzjc.adapter.index;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zznj.xzjc.R;
import com.zznj.xzjc.bean.index.AnYuKuCaseCompanyListData;
import com.zznj.xzjc.utils.StringUtils;
import com.zznj.xzjc.utils.TimeUtils;

import java.util.List;

import androidx.annotation.Nullable;

/**
 * 描述：添加类的描述
 *
 * @author wx5e48d604c2885118
 * @time 2020/4/7
 */
public class ComAdapter extends BaseQuickAdapter<AnYuKuCaseCompanyListData, BaseViewHolder> {

    public ComAdapter(int layoutResId, @Nullable List<AnYuKuCaseCompanyListData> data) {
        super(layoutResId, data);
    }

    private int type;
    public void setType(int type){
        this.type = type;
    }

    private int selectPosition = -1;
    public void setSelectPosition(int selectPosition){
        this.selectPosition = selectPosition;
        notifyDataSetChanged();
    }

    @Override
    protected void convert(BaseViewHolder helper, AnYuKuCaseCompanyListData item) {
        helper.setText(R.id.tv_tyxxdm, StringUtils.toStringForWu(item.getRegistractionNum()))
                .setText(R.id.tv_zczj,StringUtils.toStringForWu(item.getRegistractionCapital()))
                .setText(R.id.tv_frdb,StringUtils.toStringForWu(item.getProxy()))
                .setText(R.id.tv_lxdh,StringUtils.toStringForWu(item.getTel()))
                .setText(R.id.tv_dwxz,StringUtils.toStringForWu(item.getCompanyTypeName()))
                .setText(R.id.tv_zcsj, TimeUtils.getTime(item.getRegistractionTime(),"yyyy-MM-dd"))
                .setText(R.id.tv_dwmc,StringUtils.toStringForWu(item.getName()))
                .setText(R.id.tv_zcd,StringUtils.toStringForWu(item.getAddress()));
    }
}
